﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter02
{
    public class NullAndVoid : ICodeListing
    {
        public string Null { get; set; }

        public string Void { get; set; }

        public void CodeListing()
        {
            NullString();
        }

        private void NullString()
        {
            string faxNumber;
            // ...
            // Clear the value of faxNumber.
            faxNumber = null;
            //...
            Console.WriteLine(faxNumber);
        }

        private void OperateString()
        {
            Console.Write("Eneter text: ");
            var text = Console.ReadLine();
            var uppercase = text.ToUpper();
            Console.WriteLine(uppercase);
        }

        private void ImplicitlyTypedLocalVariable()
        {
            var patent1 = new { Title = "Bifocals", YearOfPublication = "1784" };
            var patent2 = new { Title = "Phonograph", YearOfPublication = "1877" };
            Console.WriteLine("{0} ({1})", patent1.Title, patent1.YearOfPublication);
            Console.WriteLine("{0} ({1})", patent2.Title, patent2.YearOfPublication);
        }
    }
}
